package MyfunUser

import (
	"fmt"
	"github.com/gin-gonic/gin"
)

func GetIndexHtml(context *gin.Context) {
	context.HTML(200, "demo01/index.html", nil)
}

func SubmitRespose(context *gin.Context) {
	userName := context.PostForm("userName")
	pwd := context.PostForm("pwd")

	infodate := gin.H{
		"userName": userName,
		"pwd":      pwd,
	}

	fmt.Println(infodate)
	context.JSON(200, infodate)

}

func AjaxResponse(context *gin.Context) {
	uname := context.PostForm("uname")

	if uname == "丽丽" {
		context.JSON(200, gin.H{
			"msg": "用户名重复",
		})
	} else {
		context.JSON(200, gin.H{
			"msg": "",
		})
	}

}
